package org.gpf.templateMethod.GetProgramStartEnd;

public abstract class ProgramRunTime {
	
	public abstract void runcode() throws Exception;	// 需要测试的代码放在这里
	
	/**
	 * 该方法不能被覆写，加入final修饰
	 * @throws Exception 
	 */
	public final long getProgramRunTime() throws Exception{
		long startTime = System.currentTimeMillis();
		runcode();
		long endTime = System.currentTimeMillis();
		return endTime - startTime;
	}
}
